
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int a[100005];
// 求x的各个位置上的数字的和
int f(int x) {
  int sum = 0;
  while (x != 0) {
    sum += x % 10;
    x /= 10;
  }
  return sum;
}

int main() {
  int n;
  cin >> n;
  a[0] = 1;
  for (int i = 1; i <= n; i++) {
    int sum = 0;
    for (int j = 0; j < i; j++) {
      sum += f(a[j]);
    }
    a[i] = sum;
  }

  cout << a[n];
  return 0;
}